<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<h:outputStylesheet library="css" name="principal.css"></h:outputStylesheet>
</h:head>

<ui:composition template="_templateFluxo.xhtml">

	<ui:define name="conteudo">
		<h:body id="body">
			<div id="panelFluxo">
				<p:panel header="Cadastro Usuário">

					<h:form>

						<h:panelGrid id="grid" columns="3">

							<p:outputLabel value="Login: " for="login" />
							<p:inputText id="login" size="20"
								value="#{usuarioBean.usuario.login}" required="true"  label="Login"/>
								<p:message for="login"/>
								

							<p:outputLabel id="Senha" for="senha" value="Senha: " />
							<p:password id="senha" size="28" feedback="true"
								value="#{usuarioBean.senha1}" required="true " label="Senha" />
								<p:message for="senha"/>

							<p:outputLabel value="Confimar Senha:  " for="senha" />
							<p:password id="senha2" size="28" value="#{usuarioBean.senha2}" required="true " label="ConfirmaSenha" />
							<p:message for="senha2"/>

							<p:outputLabel value="E-mail: " for="email" />
							<p:inputText id="email" size="30"
								value="#{usuarioBean.usuario.email}"  required="true" label="Email "/>
								<p:message for="email"/>

						</h:panelGrid>

						<h:panelGrid columns="2">
						
							<p:commandButton value="Inserir"
								actionListener="#{usuarioBean.adicionaUsuario}" action="cadastro_empresa_fluxo" ajax="true" validateClient="true" update="grid">
								<f:setPropertyActionListener value="#{usuarioBean.usuario}"
									target="#{empresaBean.usuario}" />
							</p:commandButton>
							
							<p:commandButton value="Limpar" type="reset" />
						</h:panelGrid>
					</h:form>
				</p:panel>
			</div>

		</h:body>
	</ui:define>

</ui:composition>
</html>